﻿using System;
using System.Numerics;

class MultiplySomeFactorials
{
    static void Main()
    {
        int numberN;
        int numberK;

        Console.WriteLine("Type a number N:");
        bool isFirstNumberValid = int.TryParse(Console.ReadLine(), out numberN);
        Console.WriteLine("Type a number K:");
        bool isSecondNumberValid = int.TryParse(Console.ReadLine(), out numberK);

        if (isFirstNumberValid && isSecondNumberValid)
        {
            BigInteger factorialN = 1;
            BigInteger factorialK = 1;
            BigInteger factorialKMinusN = 1;
            BigInteger result;

            for (int i = 1; i <= numberN; i++)
            {
                factorialN = factorialN*i;
            }

            for (int i = 1; i <= numberK; i++)
            {
                factorialK = factorialK * i;
            }

            for (int i = 1; i <= (numberN-numberK); i++)
            {
                factorialKMinusN = factorialKMinusN * i;
            }

            result = factorialN * factorialK / factorialKMinusN;

            Console.WriteLine("The result is {0}",result);

        }
        else
        {
            Console.WriteLine("Your input isn`t OK!!!");
        }
    }
}